package com.sunday.scoremanager.entity;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * Created by 刘涛 on 2017/10/26.
 */

public class Member implements Serializable,Parcelable{


    /**
     * sellerId : 166
     * banner : ["http://image.shoufenle.com/2017/10/1184ce3e-e5bb-4baf-a398-eee1ba16f822.jpg"]
     * shopName : 测试
     * account : 13173619585
     * openTime : 8
     * closeTime : 20
     * commissionScale : 0.1
     * permission : 1
     * address : 浙江省杭州市萧山区利丰路国泰科技大厦2201
     * desc :
     * linkMan : 圣代网络
     * linkPhone : 13173619585
     */

    private long sellerId;
    private String shopName;
    private String account;
    private String openTime;
    private String closeTime;
    private Double commissionScale;
    private int permission; //1表示老板， 2代表所有员工
    private String address;
    private String desc;
    private String linkMan;
    private String linkPhone;
    private List<String> banner;
    private String logo;
    private String nickName;
    private int isSetTradePassword;//0:否 1：设置了
    private String latitude;
    private String longitude;


    protected Member(Parcel in) {
        sellerId = in.readLong();
        shopName = in.readString();
        account = in.readString();
        openTime = in.readString();
        closeTime = in.readString();
        if (in.readByte() == 0) {
            commissionScale = null;
        } else {
            commissionScale = in.readDouble();
        }
        permission = in.readInt();
        address = in.readString();
        desc = in.readString();
        linkMan = in.readString();
        linkPhone = in.readString();
        banner = in.createStringArrayList();
        logo = in.readString();
        nickName = in.readString();
        isSetTradePassword = in.readInt();
        latitude = in.readString();
        longitude = in.readString();
    }

    public static final Creator<Member> CREATOR = new Creator<Member>() {
        @Override
        public Member createFromParcel(Parcel in) {
            return new Member(in);
        }

        @Override
        public Member[] newArray(int size) {
            return new Member[size];
        }
    };

    public long getSellerId() {
        return sellerId;
    }

    public void setSellerId(long sellerId) {
        this.sellerId = sellerId;
    }

    public String getShopName() {
        return shopName;
    }

    public void setShopName(String shopName) {
        this.shopName = shopName;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getOpenTime() {
        return openTime;
    }

    public void setOpenTime(String openTime) {
        this.openTime = openTime;
    }

    public String getCloseTime() {
        return closeTime;
    }

    public void setCloseTime(String closeTime) {
        this.closeTime = closeTime;
    }



    public int getPermission() {
        return permission;
    }

    public void setPermission(int permission) {
        this.permission = permission;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public String getLinkMan() {
        return linkMan;
    }

    public void setLinkMan(String linkMan) {
        this.linkMan = linkMan;
    }

    public String getLinkPhone() {
        return linkPhone;
    }

    public void setLinkPhone(String linkPhone) {
        this.linkPhone = linkPhone;
    }

    public List<String> getBanner() {
        return banner;
    }

    public void setBanner(List<String> banner) {
        this.banner = banner;
    }

    public String getLogo() {
        return logo;
    }

    public void setLogo(String logo) {
        this.logo = logo;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }




    public int getIsSetTradePassword() {
        return isSetTradePassword;
    }

    public void setIsSetTradePassword(int isSetTradePassword) {
        this.isSetTradePassword = isSetTradePassword;
    }


    public Double getCommissionScale() {
        return commissionScale;
    }

    public void setCommissionScale(Double commissionScale) {
        this.commissionScale = commissionScale;
    }

    public String getLatitude() {
        return latitude;
    }

    public void setLatitude(String latitude) {
        this.latitude = latitude;
    }

    public String getLongitude() {
        return longitude;
    }

    public void setLongitude(String longitude) {
        this.longitude = longitude;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeLong(sellerId);
        dest.writeString(shopName);
        dest.writeString(account);
        dest.writeString(openTime);
        dest.writeString(closeTime);
        if (commissionScale == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeDouble(commissionScale);
        }
        dest.writeInt(permission);
        dest.writeString(address);
        dest.writeString(desc);
        dest.writeString(linkMan);
        dest.writeString(linkPhone);
        dest.writeStringList(banner);
        dest.writeString(logo);
        dest.writeString(nickName);
        dest.writeInt(isSetTradePassword);
        dest.writeString(latitude);
        dest.writeString(longitude);
    }
}
